import type { Apply } from "../models/Apply";
import type { BaseResponse } from "../models/BaseResponse";
import type { BaseResponse_Apply_ } from "../models/BaseResponse_Apply_";
import type { BaseResponse_Page_Apply_ } from "../models/BaseResponse_Page_Apply_";
import type { BaseResponse_string_ } from "../models/BaseResponse_string_";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";

export class ApplyControllerService {
  /**
   * AddApply
   * @param apply apply
   * @returns BaseResponse OK
   * @returns any Created
   * @throws ApiError
   */
  public static addApplyUsingPost(
    apply: Apply
  ): CancelablePromise<BaseResponse | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/add",
      body: apply,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * agree
   * @param apply apply
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static agreeUsingPost(
    apply: Apply
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/agree",
      body: apply,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * DeleteApply
   * @param apply apply
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static deleteApplyUsingPost(
    apply: Apply
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/delete",
      body: apply,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * getApplyById
   * @param id id
   * @returns BaseResponse_Apply_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static getApplyByIdUsingPost(
    id?: string
  ): CancelablePromise<BaseResponse_Apply_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/getapply",
      query: {
        id: id,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * getApplyList
   * @param current current
   * @param size size
   * @returns BaseResponse_Page_Apply_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static getApplyListUsingPost(
    current?: number,
    size?: number
  ): CancelablePromise<BaseResponse_Page_Apply_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/getapplys",
      query: {
        current: current,
        size: size,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * refuse
   * @param apply apply
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static refuseUsingPost(
    apply: Apply
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/apply/refuse",
      body: apply,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }
}
